package Eyjafjalla.card.attack;

import Eyjafjalla.action.EyjafjallaAttackAction;
import Eyjafjalla.action.MakeTempCardInCloudAction;
import Eyjafjalla.action.UnfullMakeAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.card.skill.Marshmallow_Eyjafjalla;
import Eyjafjalla.card.status.Sunday_Eyjafjalla;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DamageAllEnemiesAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class LetRainGo_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "LetRainGo_Eyjafjalla";
    private static final CardStrings cardStrings;

    AbstractCard unUp = new Sunday_Eyjafjalla();
    AbstractCard up = new Sunday_Eyjafjalla();

    public LetRainGo_Eyjafjalla(){
        super(ID, cardStrings.NAME,2,cardStrings.DESCRIPTION,CardType.ATTACK,CardRarity.RARE,CardTarget.ALL_ENEMY);
        this.baseDamage = 18;
        this.damage =18;
        this.isMultiDamage = true;
        up.upgrade();
        this.cardsToPreview = unUp;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new LetRainGo_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new EyjafjallaAttackAction());
        //todo special effect
        addToBot(new DamageAllEnemiesAction(p,multiDamage,damageTypeForTurn, AbstractGameAction.AttackEffect.FIRE));
        addToBot(new UnfullMakeAction(isFire()?up.makeStatEquivalentCopy():unUp.makeStatEquivalentCopy(),5));
    }

    @Override
    public void applyPowers() {
        super.applyPowers();
        if(isFire()){
            cardsToPreview = up;
        }
        else {
            cardsToPreview = unUp;
        }
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeDamage(7);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}


